package com.bcbim.model_server.component.mapper;

import com.bcbim.model_server_interface.component.bo.ComponentCenterBO;
import com.bcbim.model_server_interface.component.bo.ComponentInfoBO;
import com.bcbim.model_server_interface.component.bo.ComponentMaterialBO;
import com.bcbim.model_server_interface.component.bo.ComponentTreeBO;
import com.bcbim.model_server_interface.component.dao.ComponentDAO;
import com.bcbim.model_server_interface.component.dto.CategoryComponentDTO;
import com.bcbim.model_server_interface.component.dto.ComponentMaterialDTO;
import com.bcbim.model_server_interface.component.vo.ComponentMaterialVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Description: 构件mapper
 * @Author: ye
 * @Date: 2022/4/6
 * @Version: V1.0
 **/
@Mapper
public interface ComponentMapper {

    /**
     * @Description: 新建组件数据
     * @Param: List<ComponentDAO>
     * @Return: int
     * @Author: ye
     * @Date: 2022/3/28
     */
    void insertComponents(@Param("list") List<ComponentDAO> arrElement);

    /**
     * @Description: 查询构件id
     * @Param: ComponentMaterialDTO
     * @Return: ComponentMaterialBO
     * @Author: ye
     * @Date: 2022/4/12
     */
    ComponentMaterialBO getComponentId(ComponentMaterialDTO query);

    /**
     * @Description: 查询构件树的组件
     * @Param: fileId
     * @Return: List<ComponentTreeBO>
     * @Author: ye
     * @Date: 2022/3/30
     */
    List<ComponentTreeBO> getComponentTreeComponent(String fileId);

    /**
     * @Description: 根据id查询构件信息
     * @Param: componentId
     * @Return: ComponentMaterialVO
     * @Author: ye
     * @Date: 2022/4/12
     */
    ComponentMaterialBO getComponentById(String componentId);

    /**
     * @Description: 根据类别查询构件
     * @Param: CategoryComponentDTO
     * @Return: List<ComponentInfoVO>
     * @Author: ye
     * @Date: 2022/4/29
     * @return
     */
    List<ComponentInfoBO> getComponentByCategory(CategoryComponentDTO query);

    /**
     * @Description: 查询所有的构件中点
     * @Param: String[]
     * @Return: List<ComponentCenterVO>
     * @Author: ye
     * @Date: 2022/5/13
     */
    List<ComponentCenterBO> getComponentCenter(@Param("list") String[] arrFileId);

    /**
     * @Description: 批量查询构件信息
     * @Param: componentIds
     * @Return: List<ComponentVO>
     * @Author: ye
     * @Date: 2022/6/2
     */
    List<ComponentMaterialBO> getArrComponentsById(@Param("list") String[] componentIds);

    /**
     * @Description: 获取楼层所有构件id
     * @Param: floorId
     * @Return: List<String>
     * @Author: ye
     * @Date: 2022/6/8
     */
    List<String> getFloorComponentId(String floorId);
}
